﻿using TweetSayingsLibrary.App.DataDoc;
using Dimebrain.TweetSharp.Fluent;

namespace TweetSayingsLibrary.App.Entity
{
    public class Lists
    {
        public static IDataDoc GetStatuses(string ownerScreenName, string slug)
        {            
            return Current.SessionTrack.ApiCaller.Request(t => t.Lists().GetStatuses(ownerScreenName.ToLower(), slug.ToLower()), false);
        }

        public static IDataDoc GetSubscriptions(string listOwnerScreenName)
        {
            return Current.SessionTrack.ApiCaller.Request(t => t.Lists().GetSubscriptions(listOwnerScreenName.ToLower()), false);
        }
        
        public static IDataDoc GetListsBy(string listOwnerScreenName)
        {
            return Current.SessionTrack.ApiCaller.Request(t => t.Lists().GetListsBy(listOwnerScreenName.ToLower()), true);
        }

        public static IDataDoc GetListsBy(string listOwnerScreenName, string slug)
        {
            return Current.SessionTrack.ApiCaller.Request(t => t.Lists().GetListBy(listOwnerScreenName.ToLower(), slug), true);
        }

        public static IDataDoc GetMemberships(string listOwnerScreenName)
        {
            return Current.SessionTrack.ApiCaller.Request(t => t.Lists().GetMemberships(listOwnerScreenName.ToLower()), true);
        }

		public static IDataDoc AddMemberTo(string listOwnerScreenName, string slug, long twitterId)
		{
			return Current.SessionTrack.ApiCaller.Request(t => t.Lists().AddMemberTo(listOwnerScreenName, slug, twitterId), false);
		}

		public static IDataDoc RemoveMemberFrom(string listOwnerScreenName, string slug, long twitterId)
		{
			return Current.SessionTrack.ApiCaller.Request(t => t.Lists().RemoveMemberFrom(listOwnerScreenName, slug, twitterId), false);
		}

		public static IDataDoc CreatePrivateList(string listOwnerScreenName, string listName, string description)
		{
			return Current.SessionTrack.ApiCaller.Request(t => t.Lists().CreatePrivateList(listOwnerScreenName, listName, description), false);
		}

		public static IDataDoc CreatePublicList(string listOwnerScreenName, string listName, string description)
		{
			return Current.SessionTrack.ApiCaller.Request(t => t.Lists().CreatePublicList(listOwnerScreenName, listName, description), false);
		}

		public static IDataDoc DeleteList(string listOwnerScreenName, string slug)
		{
			return Current.SessionTrack.ApiCaller.Request(t => t.Lists().DeleteList(listOwnerScreenName, slug), false);
		}

		public static IDataDoc Follow(string listOwnerScreenName, string slug)
		{
			return Current.SessionTrack.ApiCaller.Request(t => t.Lists().Follow(listOwnerScreenName, slug), false);
		}

		public static IDataDoc Unfollow(string listOwnerScreenName, string slug)
		{
			return Current.SessionTrack.ApiCaller.Request(t => t.Lists().Unfollow(listOwnerScreenName, slug), false);
		}

	}
}